import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class MyPractice {
    public static void func(String str1, String str2) {
        Set<Character> set = new HashSet<>();
        //1、将坏键盘输出的数据放入set中
        //因题例中输出结果均为大写，调用toUpperCase()存入
        for (Character ch : str2.toUpperCase().toCharArray()) {
            set.add(ch);
        }

        Set<Character> hasPrint = new HashSet<>();

        //2、遍历好键盘输入的数据，得出有问题的键
        for (Character ch : str1.toUpperCase().toCharArray()) {
            //3、用hasPrint排除已经出现过的键
            if (!set.contains(ch) && !hasPrint.contains(ch)) {
                System.out.print(ch);
                hasPrint.add(ch);
            }
        }
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNextLine()) {
            String str1 = scan.nextLine();
            String str2 = scan.nextLine();
            func(str1, str2);
        }
    }
}
